package spring.security.maven.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Server on 2015/5/23.
 */
@Controller
public class BaseController {
    @ExceptionHandler
    public String exp(HttpServletRequest request, Exception ex) {

        request.setAttribute("ex", ex);
        System.out.println("异常");
        // 根据不同错误转向不同页面
       return ex.toString();
    }
}
